///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#ifndef __MESH_H__
#define __MESH_H__

#include <Config.h>
#include <string>
#include <Model/MeshData.h>

class	Material;
class	AABBox;
class	Sphere;
class	Object;

//-----------------------------------------------------------------------------

class Mesh
{
public:
	/*	Constructor. */
				Mesh( std::string name );

	/*	Destructor. */
	virtual		 ~Mesh();

	/*
	*	Draw the model.
	*/
	void		draw( Object* obj );

	/*
	*	Mesh data
	*/
	void		SetMeshData( MeshData* meshData );
	MeshData*	GetMeshData();

	/*
	*	Material
	*/
	void		SetMaterial( Material* mat )				{	m_material = mat;	}
	Material*	GetMaterial()								{	return m_material;	}

	/*
	*	Mesh name
	*/
	std::string	GetName()									{	return m_meshName;	}
	bool		IsThisMesh( std::string name )				{	return m_meshName == name;	}

	/*
	*	Bounding elements
	*/
	bool		HasBoundingElement();
	void		generateOBB();
	AABBox*		GetOBB();
	void		generateBoundingSphere();
	Sphere*		GetBoundingSphere();

private:

	AABBox*			m_obb;
	Sphere*			m_sphere;

	std::string		m_meshName;

	Material*	m_material;
	MeshData*	m_meshData;

};

#endif // __MESH_H__
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
